interface ModalHookParam {
  dialogOpts?: Base.DialogOpts;
  callBack?: () => void;
  drawerOpts?: Base.DrawerOpts;
}

export default function ModalHook(state: ModalHookParam) {
  const { dialogOpts = {} as any, drawerOpts = {} as any, callBack = () => ({}) } = state;
  const dialogSubmitHandle = () => {
    dialogOpts.visible = false;
    callBack();
  };
  const drawerSubmitHandle = () => {
    drawerOpts.visible = false;
    callBack();
  };
  return {
    dialogSubmitHandle,
    drawerSubmitHandle
  };
}
